from appium import webdriver


desired_caps = {}
#连接设备
desired_caps['device'] = 'Android'
#连接平台
desired_caps['platformName'] = 'Android'
#连接平台的系统版本号
desired_caps['platformVersion'] = '4.3'
#连接设备名
desired_caps['deviceName'] = 'AndroidTest'
#测试的包名
desired_caps['appPackage'] = 'com.android.calculator2'
#测试的活动名
desired_caps['appActivity'] = '.Calculator'

driver = webdriver.Remote('http://localhost:4755/wd/hub', desired_caps)

driver.find_element_by_name("1").click()

driver.find_element_by_name("5").click()

driver.find_element_by_name("9").click()

driver.find_element_by_name("delete").click()

driver.find_element_by_name("9").click()

driver.find_element_by_name("5").click()

driver.find_element_by_name("+").click()

driver.find_element_by_name("6").click()

driver.find_element_by_name("=").click()

driver.quit()